import axios from "../plugin/http";

export default {
  getAccessToken(payload, cb, errorCb) {
    axios
      .post("/api/admin/getAccessToken", {
        "header": {
          "sysCode": "IDS",
          "platform": window.navigator.platform,
          "timestamp": new Date().getTime()
        },
        "payload": {
          "username": payload.username,
          "password": payload.password
        }
      })
      .then(result => {
        cb(result.data);
      })
      .catch(err => {
        errorCb(err);
      });
  }
}
